<div class="slider automatic frontpage">
    {% for entity in entities %}
        {% if entity.getWebPath() %}
            {% if entity.url %}
        <a href="{{ entity.url }}">
            {% endif %}
            <img src="{{ entity.getWebPath() }}" width="940" height="420" alt="{{ entity.id }}" />
            {% if entity.url %}
        </a>
            {% endif %}
        {% endif %}
    {% endfor %}
</div>